<?

require_once ("application.fieldset.inc");
require_once ("_field_sets/inv_ctl_items.inc");

global $_GLOBAL_DBH;
global $_OBJECT_IFACE_PANEL;
global $_IFACE_CONTROL_OBJECT;
global $_SET_TABBING;

$fs_local_document = $_REQUEST["PHP_SCRIPT"];

$return_path = array (
        array (
                fs_tab=>"inv_ctl_items",
                fs_tab_option=>"lc_inv_ctl_items",
        )
);

$return = _app_create_tabbing ("{$fs_local_document}?", $return_path);

$fs_options = array (
	addnew=>array (label=>"Add New"),
	create=>array (label=>"Create"),
	modify=>array (label=>"Modify"),
	remove=>array (label=>"Remove"),
	update=>array (label=>"Update"),
	cancel=>array (label=>"Cancel"),
	delete=>array (label=>"Delete",
			redirect=>$return),
	canret=>array (label=>"Cancel",
			redirect=>$return),
	close=>array (label=>"Close",
			redirect=>$return),
);

list ($fs_input, $fs_action, $store, $valid, $success) =

	_app_process_fieldset (array (
		fieldset=>$fs_inv_ctl_items,
		fs_options=>$fs_options,
		fs_action=>($_REQUEST["fs_action"] ?
				$_REQUEST["fs_action"] :
				"addnew"),
		fs_primary_key=>"item_id",
));

$fs_link_path = array ( 
        array (
                fs_action=>"view",
                fs_tab=>"inv_ctl_items",
                fs_tab_option=>"fs_inv_ctl_items",
                object_id=>"item_id",
                object_value=>$_REQUEST["item_id"],
        )
);

$fs_link = _app_create_tabbing ("{$fs_local_document}?", $fs_link_path);

$_OBJECT_FIELDSET_CONTROL =_app_create_fieldset_object (array (
	fieldset_id=>"fs_inv_ctl_items",
	db_conn=>$_GLOBAL_DBH,
	fieldset=>$fs_inv_ctl_items,
	fs_action=>$fs_action,
	fs_input=>$fs_input,
	fs_link=>$fs_link,
	fs_options=>$fs_options,
));

array_push ($_IFACE_CONTROL_OBJECT, $_OBJECT_FIELDSET_CONTROL);

if (($_REQUEST["fs_tab"] == "inv_ctl_items") &&
                ($_REQUEST["fs_tab_option"] == "fs_inv_ctl_items") &&
                ($_REQUEST["item_id"] > 0))
        $_SET_TABBING = true;

?>
